Image forming apparatus

ABSTRACT

An image forming apparatus includes a medium width detector and a controller that controls the medium width detector. The medium width detector detects a width of a page of print medium. The controller selects one of a plurality of medium cassettes and controls the medium width detector accordingly. When a predetermined condition is detected, the controller controls the medium width detector to detect the width of the page of print medium. The predetermined conditions include, for example, (1) when a printing operation is performed for the first time after power up of the apparatus; (2) when print data has not been received for a predetermined time length after a last reception of print data; (3) printing is performed for the first time after failure of transport of print medium occurs, a medium feeding mode is switched, and (4) when a print job is received.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to an image forming apparatus.

[0003] 2. Description of the Related Art

[0004] Conventional image forming apparatus such as a dot printer is provided with a paper width sensor. Prior to printing on print paper, a print head is caused to run in a direction substantially perpendicular to a direction of travel of the print paper, thereby detecting the width of the print paper. Then, based on the detected width of the print paper, control is performed to identify the location on the print paper on which printing should be made, thereby preventing fault printing outside of the print paper area as well as transporting the print paper to an appropriate position.

[0005] With such an image forming apparatus, the detection of paper width is performed for each page of print paper fed from a paper cassette.

[0006] However, detecting the paper width of each page prior to printing requires a longer time for printing each page, resulting in a decreased throughout of the image forming apparatus.

[0007] With the conventional apparatus, the width of print paper is detected even when the print paper is fed from the paper cassette. Because all pages of the print paper held in the same paper cassette have the same width, when a plurality of pages are to be printed, it is only necessary to detect the width of the first page.

SUMMARY OF THE INVENTION

[0008] An object of the present invention is to provided an image forming apparatus in which when pages of print paper are fed from a paper cassette, the number of times the width of print paper is detected is maintained minimum to improve the throughput of the image forming apparatus.

[0009] An image forming apparatus includes a medium-width detector and a controller. The medium-width detector detects a width of a page of print medium. The controller controls the medium-width detector to detect the width of the page of print medium upon detection of a predetermined condition.

[0010] If a printing operation is performed for a first time after power up of the image forming apparatus, the controller controls the medium-width detector to detect the width of the page of print medium.

[0011] When print data has not been received for a predetermined time length after a last reception of print data, the controller controls the medium-width detector to detect the width of the page of print medium.

[0012] When a printing operation is performed for a first time after failure of transport of the print medium occurs, the controller controls the medium-width detector to detect the width of the page of print medium.

[0013] The failure of transport of the print medium is caused by absence of print medium.

[0014] The failure of transport of the print medium is caused by abnormal transport of print medium.

[0015] When a medium feeding mode is switched from one mode to another, the controller controls the medium-width detector to detect the width of the page of print medium.

[0016] When a print job is received, the controller controls the medium-width detector to detect the width of a first page of print medium in the print job.

[0017] When printing is performed on a following page of two consecutive pages of print medium, the controller controls the medium-width detector to detect the width of the following page if the following page has a size different from a preceding page of the two consecutive pages of print medium.

[0018] When printing is performed on a following page of two consecutive pages of print medium, the controller controls the medium width detector to detect the width of the following page if the print is performed on the following page in a direction different from a preceding page of the two consecutive pages of print medium.

[0019] An image forming apparatus includes a medium-width detection and a controller. The medium-width detector that detects a width of a page of print medium. The controller controls the medium width detector to detect the width of a first page of print medium supplied from the second cassette when the controller switches from a first cassette to a second cassette.

[0020] Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention will become more fully understood from the detailed description given hereinbelow and the accompanying drawings which are given by way of illustration only, and thus are not limiting the present invention, and wherein:

[0022]FIG. 1 is a block diagram illustrating the configuration of an image forming according to a first embodiment of the invention;

[0023]FIG. 2 is a block diagram illustrating the firmware of the image forming apparatus according to the first embodiment;

[0024]FIG. 3 is a flowchart illustrating the operation for setting a paper width detecting mode;

[0025]FIG. 4 is a flowchart illustrating the operation in which paper width is detected and before printing is performed;

[0026]FIG. 5 illustrates a modification to the embodiment;

[0027]FIG. 6 illustrates a paper feeding mechanism according to the modification;

[0028]FIG. 7 is a flowchart illustrating paper-width detecting and printing operations;

[0029]FIG. 8 is a block diagram illustrating a firmware of an image forming apparatus according to a second embodiment;

[0030]FIG. 9 is a flowchart illustrating the paper-width detecting and printing operations;

[0031]FIG. 10 is a block diagram illustrating a firmware of an image forming apparatus according to a third embodiment;

[0032]FIG. 11 is a flowchart illustrating the operation of paper-width detecting and printing operations;

[0033]FIG. 12 is a block diagram of a firmware of an image forming apparatus according to a fourth embodiment; and

[0034]FIG. 13 is a flowchart illustrating the paper width detecting and printing operations.

DETAILED DESCRIPTION OF THE INVENTION

[0035] First Embodiment

[0036] {Construction}

[0037] Embodiments of the invention will be described in detail with reference to the accompanying drawings.

[0038]FIG. 1 is a block diagram illustrating the configuration of an image forming apparatus according to a first embodiment of the invention.

[0039] Referring to FIG. 1, an image forming apparatus is constructed of a main controller 11, a mechanism controlling section 12, and a detection circuit 13, a memory 14, a print data receiving section 15, and an operating panel 16.

[0040] The image forming apparatus according to the present invention takes the form of, for example, a dot impact printer that prints a dot image on print paper as a print medium. The image forming apparatus has two paper-width detection modes: a power-up-only mode in which detection of the width of print paper is performed only for the first page of the print paper after power up of the apparatus and an every-page mode in which detection of the width of print paper is performed for every page of the print paper. The image forming apparatus has a mode setting means that selectively sets either the power-up-only mode or the every-page mode.

[0041] The main controller 11 receives control data, print data, and control signals from a host apparatus, not shown, through the data receiving section 15. Then, the controller 11 analyzes the control data, produces data, and control signals and produces bit map data from the print data. The bit map data is stored into an image buffer. The data receiving section 15 receives various items of data from the host apparatus. The control signals are communicated between the data receiving section 15 and the host apparatus.

[0042] When the image forming apparatus according to the invention is a dot printer, the mechanism controlling section 12 has a plurality of dot-pins, a print head 12 a, a space motor 12 b, and a line feed motor 12 c. The dot-pins print a dot pattern produced by the main controller 11. The space motor 12 b drives the print head 12 a to move in a direction substantially perpendicular to the direction of travel of the print paper. The line feed motor 12 c performs line feeding of the print paper.

[0043] The detection circuit 13 receives detection signals from a width sensor 13 a and a length sensor 13 b. The width sensor 13 a detects the paper width while the length sensor 13 b detects the leading end and trailing end of the print paper. The width sensor 13 a is mounted on the print head 12 a.

[0044] The memory 14 has a buffer memory that stores the print data supplied from the main controller 11 before the print data is converted into bit map data in an image buffer. The memory 14 also includes a memory area that stores data such as the width and length of print paper detected by the detection circuit 13. The memory 14 further includes a non-volatile memory that stores a set-up mode selected through the operating panel 16.

[0045] The operating panel 16 has operation keys, not shown, for selecting operation modes including an operation mode in which the paper width is detected, and a display panel for displaying the operation status of the apparatus.

[0046] The firmware of the image forming apparatus will be described.

[0047]FIG. 2 is a block diagram illustrating the firmware of the image forming apparatus according to the first embodiment.

[0048] The firmware includes an initial-detection-mode setting section 21, a paper feeding section 22, a width detection mode setting section 23, a paper-width detecting section 24, and a printing section 25. The main controller 11 activates the width detecting section 24 only in a particular case as described later.

[0049] The initial-detection-mode setting section 21 sets a detection mode, which is an initial set-up performed immediately after the image forming apparatus is turned on. When the paper-feeding section 22 receives a paper feeding command from a host apparatus, not shown, the paper-feeding section 22 performs a paper-feeding operation. In accordance with the status of the paper width detecting section 24 and the initial-detection-mode setting section 21, the width detection mode setting 23 determines whether a paper-width detecting operation should be performed. The width detecting section 24 drives the print head 12 a to run in the direction of width of the print paper, thereby detecting the width of the print paper based on the detection signal output from the width sensor 13 a mounted on the print head 12 a. The printing section 25 processes the print data for one page of print paper received from the host apparatus.

[0050] {Operation}

[0051] The operation of the image forming apparatus of the aforementioned configuration will be described.

[0052] Set-Up Mode

[0053]FIG. 3 is a flowchart illustrating the operation for setting the paper-width detection mode.

[0054] A set-up operation for specifying the paper-width detection mode will be described.

[0055] When the user attempts to activate a set-up mode by operating an operation key on the operation section 16, a check is made to determine whether the paper-width detection mode has been activated (S1). If the paper-width detection mode has not been activated yet, then set-up operations in other set-up modes than the paper-width detection mode are performed for set-up operations (S3).

[0056] If it is determined that the paper-width detection mode has been activated, then selection is made to specify the proper paper-width detection mode, in other words, selection is made to specify either the every-page mode or the power-up-only mode (S2). Whichever mode is selected, the selected mode is stored into the non-volatile memory in the memory 14 (S4, S5).

[0057] The flowchart in FIG. 3 will be described.

[0058] Step S1: A check is made to determine whether the paper-detection mode has been set. If YES, the program proceeds to step S2, and if NO, the program proceeds to step S3.

[0059] Step S2: A check is made to determine which mode has been selected. If the every-page mode is selected, the program proceeds to step S4, and if the power-up-only mode is selected, the program proceeds to step S5.

[0060] Step S3: Set-up operations in other set-up modes than the paper-width detection mode are performed.

[0061] Step S4: The paper-width detection is set the power-up-only mode, which in turn is stored into the non-volatile memory.

[0062] Step S5: The paper-width detection is set to the every-page mode, which in turn is stored into the non-volatile memory.

[0063] Paper-Width Detection and Printing

[0064]FIG. 4 is a flowchart illustrating the operation in which paper width is detected and printing is performed.

[0065] The paper-width detecting and printing operations will be described.

[0066] Upon power-up of the image forming apparatus, a detection operation flag is set as an initial setting (S11). Then, upon receiving the paper feeding command from the host apparatus, the paper feeding operation is initiated (S12). When the paper feeding operation is completed, the paper-width detection mode is read from the non-volatile memory of the memory 14, thereby activating either the every-page mode or the power-up-only mode (S13).

[0067] In the every-page mode, the paper-width detecting section 24 drives the print head 12 a to run in the direction of width of the print paper, enabling the width sensor 13 a to detect the width of the print paper (S16).

[0068] In the power-up-only mode, a check is made to determine whether the detection operation flag has been set (S14). If the detection operation flag has been set (Y at step S14), the detection operation flag is reset and the paper-width detection is performed (S15) and subsequently the paper-width detection is performed (S16). Then, the print data for one page received from the host apparatus is processed and printing is performed (S17). Then, the next page is fed (S12).

[0069] If the detection operation flag has been reset (N at step S14), the paper-width detection is not performed and printing begins immediately (S17). Because the power-up-only mode was activated to determine whether printing is performed for the first time after the image forming apparatus is turned on, once the detection operation flag has been reset (S15), the paper-width detection will not be performed for subsequent pages of print paper.

[0070] The operation of paper-width detection and printing will be described.

[0071] Step S11: The detection operation flag is set.

[0072] Step S12: A check is made to determine whether the paper feeding command has been received. If YES, the program proceeds to step S13, and if NO, the program enters a standby state where the paper feeding operation is not performed.

[0073] Step S13: A check is made to determine whether the paper-detection mode is in the every-page mode or in the power-up-only mode. If the every-page mode has been set, then the program proceeds to step S16, and if the power-up-only mode has been set, then the program proceeds to step S14.

[0074] Step S14: A check is made to determine whether the detection operation flag has been set. If YES, the program proceeds to step S15. If NO, the program proceeds to step S17.

[0075] Step S15: The detection operation flag is set.

[0076] Step S16: The paper-width detection is performed.

[0077] Step S17: Printing is performed.

[0078] Step S18: A check is made to determine whether printing has been completed. If YES, the program ends. If NO, the program loops back to Step S12.

[0079] The invention minimizes the number of times the width of the print paper fed from the paper cassette is detected, thereby preventing the throughput of the image forming apparatus from decreasing.

[0080] The present invention utilizes the fact that the size of print paper is not changed very often after the apparatus is turned on. Thus, when the power-up-only mode is specified, the detection of the print paper is performed only once.

[0081] When the paper size of the second page onward is different from the first page, or the width of the print paper should be detected very accurately, the paper-width detection may be readily switched to the every-page mode in which paper-width detection is performed for every page of print paper.

[0082] {Modification}

[0083] While the first embodiment has been described with respect to a dot printer, the invention is also applicable to an electrophotographic apparatus such as an electrophotographic printer and an electrophotographic copying machine.

[0084]FIG. 5 illustrates a modification to the embodiment.

[0085] A modification to the first embodiment will briefly be described with reference to FIG. 5. A stack of print paper P is held in a paper cassette of a paper feeding mechanism. The print paper P is fed by feeding rollers 112 a-112 b or 101 a-101 b to an image forming section 102. An electrostatic latent image is formed on a photoconductive drum 121. A developing roller 122 supplies toner, not shown, to the electrostatic latent image to form a toner image. Then, a transfer roller transfers the toner image onto a print paper. The print paper P is then transported to a fixing unit 103 where the print paper is pulled in between a pair of fixing rollers 131 a 131 b so that the toner image is fused under pressure and by heat into a permanent image. The print paper P is then discharged through a discharge port 104 from the image forming apparatus.

[0086]FIG. 6 illustrates a paper feeding mechanism according to the modification.

[0087] A paper feeding operation will be described with reference to FIG. 6. The print paper P in the paper cassette 111 a or 111 b is advanced by a hopping roller 113 a or 113 b to the feeding rollers 112 a and 112 b. Reflective sensors 105 a, 105 b, and 105 c as a medium-width detector are spaced apart by predetermined distances in a direction transverse to a direction of travel of the print paper P. The respective sensors 105 a, 105 b, and 105 c detect light reflected back by print paper P of corresponding sizes A, B, and C, respectively, thereby detecting the size of the print paper P.

[0088] The number of sensors 105 a, 105 b, and 105 c and the positions of the sensors 105 a, 105 b, and 105 c can be selected as desired. If the image forming apparatus incorporates a plurality of paper cassettes, a controller selects a paper cassette from the plurality of paper cassettes and printing is performed on the print paper P supplied from the selected paper cassette. When the controller switches from one paper cassette to another paper cassette, the controller controls the sensors 105 a, 105 b, and 105 c to detect the width of a first page of print paper P supplied from the selected paper cassette.

[0089]FIG. 7 is a flowchart illustrating paper-width detecting and printing operations.

[0090] The paper width detecting and printing operations will be described with reference to FIG. 7.

[0091] When the image forming apparatus is turned on, the detection operation flag is first set (S121). Then, a check is made to determine whether the controller has switched from one paper cassette to another paper cassette (S122). If the controller has switched from one paper cassette to another paper cassette (S122), then the detection operation flag is set (S123) and subsequently the paper feeding operation begins (S124) upon a paper feeding command from the host apparatus. If the controller has not switched from one paper cassette to another paper cassette (S122), the program waits for a paper feeding command from the host apparatus (S124).

[0092] After the paper feeding operation begins (S124), a check is made to determine whether the detection operation flag has been set (S125). If the detection operation flag has been set (S125), the detection operation flag is reset (S126) and the paper-width detection operation is performed (S127) before performing a printing operation (S128). If the detection operation flag has not been set (S125), a printing operation begins immediately (S128). Subsequently, print data for one page is received from the host apparatus and processed for printing data. Then, the next page of print paper is fed.

[0093] The paper-width detecting and printing operations will be described with reference to the flowchart.

[0094] Step S121: The detection operation flag is set.

[0095] Step S122: A check is made to determine whether the controller has switched from one paper cassette to another paper cassette. If the controller has switched from one paper cassette to another paper cassette, then program proceeds to step S123. If the controller has not switched from one paper cassette to another paper cassette, the program proceeds to step S124.

[0096] Step S123: The detection operation flag is set.

[0097] Step S124: A check is made to determine whether a paper feeding command is received. If the paper feeding command has been received, the program proceeds to step S126, if the paper feeding command has not been received, the program enters a standby state.

[0098] Step S125: A check is made to determine whether the detection operation flag has been set. If YES, the program proceeds to step S126, and if NO, the program proceeds to step S128.

[0099] Step S126: The detection operation flag is reset.

[0100] Step S127: The paper-width detection is performed.

[0101] Step S128: Printing is performed.

[0102] Step S129: A check is made to determine whether printing has been completed. If YES, the program ends. If NO, the program loops back to Step S122.

[0103] Second Embodiment

[0104] A second embodiment will be described with reference to FIGS. 8 and 9.

[0105]FIG. 8 is a block diagram illustrating a firmware of an image forming apparatus according to the second embodiment.

[0106] The second embodiment is featured in that when a printing operation is to be performed a certain length of time after print data is no longer supplied from a host apparatus, detection of the width of print paper is performed.

[0107] The second embodiment differs from the first embodiment in that a data-reception determining section 26 is provided as shown in FIG. 8. The data-reception determining section 26 resets a timer at a timing when the data-receiving section 15 receives data from a host apparatus, not shown. Then, the timer begins to count up. If the data receiving section 15 does not receive print data for a predetermined length of time, the timer continues to count up. The data-reception determining section 26 monitors the timer count to determine whether the timer count exceeds a predetermined time length by, for example, 2 seconds. When the timer count exceeds the predetermined time length by 2 seconds, the detection operation flag is set.

[0108]FIG. 9 is a flowchart illustrating paper-width detecting and printing operations.

[0109] The paper width detecting and printing operations will be described.

[0110] When the image forming apparatus is turned on, the detection operation flag is first set (S21). Then, the data reception determining section 26 resets the timer count upon reception of print data for each page, and thereafter the timer counts up. The data reception determining section 26 monitors the timer count to determine whether the timer count exceeds a predetermined time length by, for example, 2 seconds before any print data is received. When the timer count exceeds the predetermined time length by 2 seconds, the detection operation flag is set (S23).

[0111] In the second embodiment, an elapsed time length between data receptions from the host apparatus is monitored. If no print data is received for a predetermined time length (S22), the detection operation flag is set (S23). In other words, when print data for a plurality of pages is being received in sequence, the detection operation flag is not set and therefore, the paper-width detection is not performed. If the data reception is interrupted for a time length longer than a predetermined value, then the paper-width detection is performed for the first page of print paper fed after the interruption. Alternatively, the paper-width detection may also be performed on a job-to-job basis. In other words, the paper-width detection may be performed for the first page in each printing job.

[0112] Subsequently, a paper feeding operation begins upon the paper feeding command from the host apparatus (S24). After the paper feeding operation, a check is made to determine whether the detection operation flag has been set (S25). If the detection operation flag has been set, the detection operation flag is reset (S26) and then the paper-width detection is performed (S27). Subsequently, print data for one page received from the host apparatus is processed and printed (S28). Then, the next page of print paper is fed.

[0113] The paper-width detecting and printing operations will be described with reference to the flowchart.

[0114] Step S21: The detection operation flag is set.

[0115] Step S22: A check is made to determine whether the data receiving section 15 has not received print data for a predetermined time length. If the data has not been received, the program proceeds to step S23. If the data has been received, the program proceeds to step S24.

[0116] Step S23: The detection operation flag is set.

[0117] Step S24: A check is made to determine whether the paper feeding command has been received. If the paper feeding command has been received, the program proceeds to step S25, if the paper feeding command has not been received, the program enters a standby state.

[0118] Step S25: A check is made to determine whether the detection operation flag has been set. If YES, the program proceeds to step S26, and if NO, the program proceeds to step S28.

[0119] Step S26: The detection operation flag is reset.

[0120] Step S27: The paper-width detection is performed.

[0121] Step S28: Printing is performed.

[0122] Step S29: A check is made to determine whether printing has been completed. If YES, the program ends. If NO, the program loops back to Step S22.

[0123] The second embodiment addresses a problem encountered when the user loads a stack of print paper in the paper cassette with the apparatus remaining turned on. When the receipt of the print data from the host apparatus is interrupted, the paper-width detection is performed for the first page of print paper fed after the interruption. This paper-width detection prevents the print data supplied after the interruption from being printed on print paper of the wrong size. Also, when a plurality of pages of print paper are being printed without interruption, the paper-width detection operation is not performed so that the overall throughput of the image forming apparatus is prevented from decreasing.

[0124] The second embodiment allows paper-width detection to be performed at an appropriate timing without providing an additional sensor for detecting that print paper is replenished into the paper cassette. Thus, the second embodiment prevents the overall cost of the image forming apparatus from increasing.

[0125] An apparatus according to the second embodiment may include the power-up-only mode described in the first embodiment. Alternatively, the main controller 11 may store into a memory the paper-width information on the final page of print paper that was used in the printing operation performed immediately before the apparatus is turned off. Then, when the apparatus is turned on again, the main controller 11 may read the information from the memory and set the paper width.

[0126] Third Embodiment

[0127] Elements similar to those in the first and second embodiments have been given the same reference numerals and the description thereof is omitted.

[0128]FIG. 10 is a block diagram illustrating a firmware of an image forming apparatus according to a third embodiment.

[0129] The third embodiment has a feature that when the paper feeding from a paper cassette fails, paper-width detection is performed for the first page of the print paper supplied after the failure of paper feeding.

[0130] The third embodiment differs from the first embodiment in that a feed-failure determining section 27 is added.

[0131]FIG. 11 is a flowchart illustrating the operation of paper-width detection and printing.

[0132] When the image forming apparatus is turned on, the detection operation flag is first set (S31). Upon receiving a paper feeding command from a host apparatus (S32), the feed-failure determining section 27 checks a detection signal of the paper sensor 13 b to determine whether the print paper is present in the paper cassette (S33). If the print paper is absent from the paper cassette (S33), then the detection operation flag is set (S34). After a stack of print paper is loaded into the paper cassette, the paper feeding operation is performed again upon receiving the paper feeding command from a host apparatus (S32).

[0133] When it is determined that the print paper is present in the paper cassette, a check is made to determine whether the detection operation flag has been set (S35). If the detection operation flag has been set, the detection operation flag is reset (S36) and the paper-width detection is performed (S37). Subsequently, the print data for one page received from the host apparatus is processed and printed and then the next page is fed. If the detection operation flag has not been set (S35), i.e., the detection operation flag has been reset, then printing is performed without performing the paper-width detection (S38).

[0134] As described above, when failure of paper feeding occurs, i.e., when the print paper is not present in the paper cassette or not normally fed from the paper cassette, the paper-width detection is performed for the first page of print paper supplied after the occurrence of failure of paper feeding.

[0135] The flowchart will be described.

[0136] Step S31: The detection operation flag is set.

[0137] Step S32: A check is made to determine whether a command for paper feeding has been received. If YES, the program proceeds to step S33. If NO, the program enters a standby state.

[0138] Step S33: A check is made to determine whether the print paper is present in the paper cassette. If YES, the program proceeds to step S35. If NO, the program proceeds to step S34.

[0139] Step S34: The detection operation flag is set.

[0140] Step S35: A check is made to determine whether the detection flag has been set. If YES, the program proceeds to step S36. If NO, the program proceeds to step S38.

[0141] Step S36: The paper detection operation is performed.

[0142] Step S38: Printing is performed.

[0143] Step S39: A check is made to determine whether printing has been completed. If YES, the program ends. If NO, the program loops back to Step S32.

[0144] The third embodiment addresses a case in which when the print paper in the paper cassette is exhausted, the user loads a stack of print paper into the paper cassette with the apparatus remaining turned on. The paper-width detection is performed for the first page of print paper fed after the interruption. This prevents the print data supplied after the interruption from being printed on the print paper of the wrong size. The paper-width detection is not performed for pages after the first page, thereby preventing the throughput of the image forming apparatus from decreasing.

[0145] The paper-width detection can be performed at an appropriate timing without providing an additional sensor for detecting the replenishment of the print paper into the paper cassette.

[0146] An apparatus according to the third embodiment may include the power-up-only mode described in the first embodiment. Alternatively, the main controller 11 may store into a memory the paper-width information on the final page of print paper that was used in the printing operation performed immediately before the apparatus is turned off. Then, when the apparatus is turned on again, the main controller 11 may read the information from the memory and set the paper width.

[0147] Fourth Embodiment

[0148] Elements similar to those in the first to third embodiments have been given the same references and the description is omitted.

[0149]FIG. 12 is a block diagram of a firmware of an image forming apparatus according to a fourth embodiment.

[0150] The fourth embodiment is featured in that when a paper feeding is switched from one paper feeding port to a paper cassette, the width of print paper is detected for the first page of print paper fed from the paper cassette.

[0151] The fourth embodiment differs from the first embodiment in that a paper-feeding mode determining section 28 is added. The paper feeding mode determining section 28 determines whether the paper feeding mode has been switched from, for example, a manual feeding mode or a continuous form mode to a paper cassette mode.

[0152]FIG. 13 is a flowchart illustrating the paper width detecting and printing operations.

[0153] The paper-width detecting and printing operations will be described.

[0154] When the image forming apparatus is turned on, the detection operation flag is set as an initial set-up (S41). Then, the paper-feeding mode determining section 28 determines whether the paper feeding mode has been switched from, for example, the manual feeding mode or continuous form mode to the paper cassette mode (S42). If YES, then the detection operation flag is set (S43). If NO, print paper is fed in a mode different from the paper cassette mode (S44).

[0155] When the paper feeding command is received from the host apparatus, the paper feeding is initiated. Upon completion of paper feeding, a check is made to determine whether the detection operation flag has been set (S45). If the detection operation flag has been set, the detection operation flag is reset (S46) and the paper-width detection is performed (S47). Subsequently, the print data for one page of print paper received from the host apparatus is processed to print on the print paper, and then the next page of print paper is fed. If the detection operation flag has not been set, i.e., the detection operation flag has been reset (S45), the paper-width detection is not performed and printing is performed immediately (S48).

[0156] As described above, when printing is being performed on the print paper fed only from the same paper cassette, the paper detection operation is performed only once. Additionally, paper-width detection is performed for the first page of the print paper fed from the paper cassette after the paper feeding mode is switched from other paper feeding mode to the cassette feeding mode. The paper-width detection may also be performed when a different paper size is specified or when a direction in which printing is performed on the print paper is changed.

[0157] The flowchart will be described.

[0158] Step S41: The detection operation flag is set.

[0159] Step S42: A check is made to determine whether the paper feeding mode has been changed. If YES, the program proceeds to step s43.

[0160] If NO, the program proceeds to

[0161] Step S43.

[0162] Step S43: The detection operation flag is set.

[0163] Step S44: A check is made to determine whether a paper feeding command is received. If YES, the program proceeds to step S45. If NO, the program enters a standby state in which the program awaits the paper feeding command.

[0164] Step S45: A check is made to determine whether detection operation flag has been set. If YES, the program proceeds to step S46. If NO, the program proceeds to step S48.

[0165] Step S46: The detection operation flag is reset.

[0166] Step S47: The paper-width detection is performed.

[0167] Step S48: Printing is performed.

[0168] Step S49: A check is made to determine whether printing has been completed. If YES, the program ends. If NO, the program loops back to Step S42.

[0169] An apparatus according to the fourth embodiment may include the power-up-only mode described in the first embodiment. Alternatively, the main controller 11 may store into a memory the paper-width information on the final page of print paper that was used in the printing operation performed immediately before the apparatus is turned off. Then, when the apparatus is turned on again, the main controller 11 may read the information from the memory and set the paper width.

[0170] As described above, when the image forming apparatus remains turned on, if the paper feeding mode is switched from a mode to the paper cassette mode, the paper-width detection is performed to prevent printing on the paper of the wrong size. The paper-width detection is not performed for pages after the first page, thereby preventing the throughput of the image forming apparatus from decreasing.

[0171] The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art intended to be included within the scope of the following claims. 

What is claimed is:
 1. An image forming apparatus, comprising: a medium-width detector that detects a width of a page of print medium; and a controller that controls said medium-width detector to detect the width of the page of print medium upon detection of a predetermined condition.
 2. The image forming apparatus according to claim 1, wherein when a printing operation is performed for a first time after power up of the image forming apparatus, said controller controls said medium-width detector to detect the width of the page of print medium.
 3. The image forming apparatus according to claim 1, wherein when print data has not been received for a predetermined time length after a last reception of print data, said controller controls said medium-width detector to detect the width of the page of print medium.
 4. The image forming apparatus according to claim 1, wherein when a printing operation is performed for a first time after failure of transport of the print medium occurs, said controller controls said medium-width detector to detect the width of the page of print medium.
 5. The image forming apparatus according to claim 4, wherein the failure of transport of the print medium is caused by absence of print medium.
 6. The image forming apparatus according to claim 4, wherein the failure of transport of the print medium is caused by abnormal transport of print medium.
 7. The image forming apparatus according to claim 1, wherein when a medium feeding mode is switched from one mode to another, said controller controls said medium-width detector to detect the width of the page of print medium.
 8. The image forming apparatus according to claim 1, wherein when a print job is received, said controller controls said medium-width detector to detect the width of a first page of print medium in the print job.
 9. The image forming apparatus according to claim 1, wherein when printing is performed on a following page of two consecutive pages of print medium, said controller controls said medium-width detector to detect the width of the following page if the following page has a size different from a preceding page of the two consecutive pages of print medium.
 10. The image forming apparatus according to claim 1, wherein when printing is performed on a following page of two consecutive pages of print medium, said controller controls said medium width detector to detect the width of the following page if the print is performed on the following page in a direction different from a preceding page of the two consecutive pages of print medium.
 11. An image forming apparatus, comprising: a medium-width detector that detects a width of a page of print medium held in a cassette; and a controller that controls said medium-width detector, wherein when said controller switches from a first cassette to a second cassette, said controller controls said medium-width detector to detect the width of a first page of print medium supplied from the second cassette 